package Test;

import java.util.Scanner;

public class Test6 {
    //汉诺塔
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int n = scan.nextInt();
        hanoi(n, 'a', 'b', 'c');
    }

    private static void hanoi(int n, char x, char y, char z) {
        int move=0;
        if(n==1){
            move(x, z);
        } else{
            hanoi(n-1,x,z,y);
            move(x,z);
            hanoi(n-1,y,x,z);
        }

    }

    private static void move(char x, char z) {
        System.out.println(x+"->"+z);

    }
}
